# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 6
_modified_time = 1317990962.447656
_template_filename='/home/wolfking/workspace/tornado/Soy/application/views/profile/add_api.html'
_template_uri='/profile/add_api.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from whirlwind.view.filters import Filters, Cycler
_exports = ['lhs', 'jquery_script']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    pass
def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, u'/layouts/content.html', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        __M_writer = context.writer()
        # SOURCE LINE 2
        __M_writer(u'\n')
        # SOURCE LINE 3
        __M_writer(u'\n')
        # SOURCE LINE 24
        __M_writer(u'\n\n')
        # SOURCE LINE 30
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_lhs(context):
    context.caller_stack._push_frame()
    try:
        username = context.get('username', UNDEFINED)
        mykeys = context.get('mykeys', UNDEFINED)
        available_keys = context.get('available_keys', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 4
        __M_writer(u'\n<div style="margin-bottom: 15px; margin-left:10px">\n    <h1>')
        # SOURCE LINE 6
        __M_writer(unicode(username))
        __M_writer(u"'s API</h1>\n")
        # SOURCE LINE 7
        if not mykeys:
            # SOURCE LINE 8
            __M_writer(u'    <p>You have not register any api yet!<p>\n')
            # SOURCE LINE 9
        else:
            # SOURCE LINE 10
            for key in mykeys:
                # SOURCE LINE 11
                __M_writer(u'        <p>')
                __M_writer(unicode(key))
                __M_writer(u'</p> \n')
                pass
            pass
        # SOURCE LINE 14
        if available_keys:
            # SOURCE LINE 15
            __M_writer(u'    <p>You can register the following apis</p>\n    <form id="fm-api-register" action="/profile/add_api" method="POST">\n')
            # SOURCE LINE 17
            for available_key in available_keys:
                # SOURCE LINE 18
                __M_writer(u'            <input type="CHECKBOX" name="apis" value="')
                __M_writer(unicode(available_key))
                __M_writer(u'"/> ')
                __M_writer(unicode(available_key))
                __M_writer(u'\n')
                pass
            # SOURCE LINE 20
            __M_writer(u'        <button id="bt-api-register">Register APIs</button>\n    </form>\n')
            pass
        # SOURCE LINE 23
        __M_writer(u'</div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_jquery_script(context):
    context.caller_stack._push_frame()
    try:
        __M_writer = context.writer()
        # SOURCE LINE 26
        __M_writer(u'\n$("button#bt-api-register").click(function(){\n    $("#fm-api-register").submit();\n});\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


